import 'package:flutter/material.dart';
import './text.dart';

class TextControl extends StatefulWidget {
  final String astring;
  TextControl(this.astring );

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState
    return TextControlState();
  }
}

class TextControlState extends State<TextControl> {
  final List<String> _strList = [];

  @override
  void initState() {
    _strList.add(widget.astring);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(appBar: AppBar(
      title: Text('Practice'),
    ),
    body: Column(children: <Widget>[
      Container(
        child: RaisedButton(
          child: Text('+'),
          onPressed: () {
            setState(() {
              print(_strList);
              _strList.add('aaa');
              
            });
          }),
      ),
      TextContainer(_strList)
    ])
    );
  }
}
